<%inherit file="/wml/base.mako" />

<template>
	<do name="back" type="prev" label="Back">
		<prev/>
	</do>
</template>

% if c.folders:
	<card id="folders" title="Folders in ${c.folder}">
		<do type="options" label="Actions">
			<go href="#actions" />
		</do>
		<p><table columns="3">
			<tr>
				<td>Name</td>
				<td>Unread</td>
				<td>Total</td>
			</tr>
			% for f in c.folders:
			<tr>
				<td><a href="${h.url_escape(h.url_for('folder_view', fname=f))}">${h.escape(f)}</a></td>
				% if f.unread():
				<td>${f.unread()}</td>
				% else:
				<td>--</td>
				% endif

				% if f.total():
				<td>${f.total()}</td>
				% else:
				<td>--</td>
				% endif
			</tr>
			% endfor
		</table></p>
	</card>
	<card id="actions" title="Actions">
		<p><a href="${h.url_escape(h.url_for('folder_view', fname=c.folder))}">View Messages</a></p>
                <%include file="/wml/common.mako" />
	</card>
% endif

% if not c.folders:
<card title="${c.folder}">
	<p>Huh. No subfolders.</p>
</card>
% endif
